package com.ezops.dtcc.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.ezops.dtcc.model.AckNack;

public class AcknowledgementRowMapper {
	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
		AckNack ackNack = new AckNack();
		ackNack.setRepository(rs.getString("REPOSITORY"));
		ackNack.setSource(rs.getString("SOURCE"));
		ackNack.setSubmittedForPrefix(rs.getString("SUBMITTED_FOR_PREFIX"));
		ackNack.setSubmittedForValue(rs.getString("SUBMITTED_FOR_VALUE"));
		ackNack.setDateSubmitterPrefix(rs.getString("DATE_SUBMITTER_PREFIX"));
		ackNack.setDateSubmitterValue(rs.getString("DATE_SUBMITTER_VALUE"));
		ackNack.setPrimaryAssetClass(rs.getString("PRIMARY_ASSET_CLASS"));
		ackNack.setProductIdPrefix(rs.getString("PRODUCT_ID_PREFIX"));
		ackNack.setProductIdValue(rs.getString("PRODUCT_ID_VALUE"));
		ackNack.setMessageId(rs.getString("MESSAGE_ID"));
		ackNack.setEventId(rs.getString("EVENT_ID"));
		ackNack.setUsiPrefix(rs.getString("USI_PREFIX"));
		ackNack.setUsiValue(rs.getString("USI_VALUE"));
		ackNack.setUtiPrefix(rs.getString("UTI_PREFIX"));
		ackNack.setUti(rs.getString("UTI"));
		ackNack.setPriorUsiPrefix(rs.getString("PRIOR_USI_PREFIX"));
		ackNack.setPriorUsiValue(rs.getString("PRIOR_USI_VALUE"));
		ackNack.setPriorUtiPrefix(rs.getString("PRIOR_UTI_PREFIX"));
		ackNack.setPriorUti(rs.getString("PRIOR_UTI"));
		ackNack.setTradeParty1TransactionId(rs.getString("TRADE_PARTY1_TRANSACTION_ID"));
		ackNack.setTradeParty2TransactionId(rs.getString("TRADE_PARTY2_TRANSACTION_ID"));
		ackNack.setMessageType(rs.getString("MESSAGE_TYPE"));
		ackNack.setAction(rs.getString("ACTION"));
		ackNack.setTransactionType(rs.getString("TRANSACTION_TYPE"));
		ackNack.setTradeParty1Role(rs.getString("TRADE_PARTY1_ROLE"));
		ackNack.setTradeParty1Prefix(rs.getString("TRADE_PARTY1_PREFIX"));
		ackNack.setTradeParty1Value(rs.getString("TRADE_PARTY1_VALUE"));
		ackNack.setTradeParty2Role(rs.getString("TRADE_PARTY2_ROLE"));
		ackNack.setTradeParty2Prefix(rs.getString("TRADE_PARTY2_PREFIX"));
		ackNack.setTradeParty2Value(rs.getString("TRADE_PARTY2_VALUE"));
		ackNack.setExecutionTimestamp(rs.getDate("EXECUTION_TIMESTAMP") != null ? rs.getDate("EXECUTION_TIMESTAMP") : null);
		ackNack.setTradeDate(rs.getDate("TRADE_DATE") != null ? rs.getDate("TRADE_DATE") : null);
		ackNack.setEffectiveDate(rs.getDate("EFFECTIVE_DATE") != null ? rs.getDate("EFFECTIVE_DATE") : null);
		ackNack.setVerificationType(rs.getString("VERIFICATION_TYPE"));
		ackNack.setConfirmationDateTime(rs.getDate("CONFIRMATION_DATETIME") != null ? rs.getDate("CONFIRMATION_DATETIME") : null);
		ackNack.setConfirmationType(rs.getString("CONFIRMATION_TYPE"));
		ackNack.setAsOfDateTime(rs.getDate("AS_OF_DATE") != null ? rs.getDate("AS_OF_DATE") : null);
		ackNack.setValuationDateTime(rs.getDate("VALUATION_DATETIME") != null ? rs.getDate("VALUATION_DATETIME") : null);
		ackNack.setMandatoryClearingIndicator(rs.getString("MANDATORY_CLEARING_INDICATOR"));
		ackNack.setParty1ReportingObligation(rs.getString("PARTY1_REPORTING_OBLIGATION"));
		ackNack.setParty2ReportingObligation(rs.getString("PARTY2_REPORTING_OBLIGATION"));
		ackNack.setReportingJurisdiction(rs.getString("REPORTING_JURISDICTION"));
		ackNack.setParty1VoluntarySubmission(rs.getString("PARTY1_VOLUNTARY_SUBMISSION"));
		ackNack.setParty2VoluntarySubmission(rs.getString("PARTY2_VOLUNTARY_SUBMISSION"));
		ackNack.setAckOrNack(rs.getString("ACK_OR_NACK"));
		ackNack.setReasonCode(rs.getString("REASON_CODE"));
		ackNack.setReasonDescription(rs.getString("REASON_DESCRIPTION"));
		ackNack.setNetReportingObligation(rs.getString("NET_REPORTING_OBLIGATION"));
		ackNack.setCftcExpected(rs.getString("CFTC_EXPECTED"));
		ackNack.setCftcActual(rs.getString("CFTC_ACTUAL"));
		ackNack.setCftcDeviation(rs.getString("CFTC_DEVIATION"));
		ackNack.setEsmaExpected(rs.getString("ESMA_EXPECTED"));
		ackNack.setEsmaActual(rs.getString("ESMA_ACTUAL"));
		ackNack.setEsmaDeviation(rs.getString("ESMA_DEVIATION"));
		ackNack.setFpml(rs.getString("FPML"));
		ackNack.setInsertTimestamp(rs.getDate("INSERT_TIMESTAMP"));

		return ackNack;
	}
}
